package com.vma.jifu.backsys.controller;

import com.vma.jifu.bizModel.model.Areas;
import com.vma.jifu.bizModel.model.Cities;
import com.vma.jifu.bizModel.model.Provinces;
import com.vma.jifu.others.CommonService;
import com.vma.jifu.others.impl.CommonServiceImpl;


import java.util.List;

/**
 * Created by kitabi on 2017/6/23.
 */
public class CommonController extends  BaseController{

    CommonService commonService = new CommonServiceImpl();

    /**
     * 查询省份
     *

     */
    public void qryProvinces(){
        List<Provinces> provincesList = commonService.qryProvinces("");
        renderJson( provincesList);
    }

    /**
     * 查询城市
     *
     *
     */
    public void qryCities(){
        int province = getParaToInt("province");

        List<Cities> citiesList = commonService.qryCities("",province);

        renderJson(citiesList);
    }

    /**
     * 查询地区
     *

     */
    public void qryAreas(){
        int city = getParaToInt("city");

        List<Areas> areasList = commonService.qryAreas("",city);

        renderJson(areasList);
    }
}
